home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-05 / drivers2.zip / VERIFYPI.ASM < prev    next >
Assembly Source File  |  1990-11-26  |  901b  |  33 lines

  1. signature    db    'PKT DRVR',0
  2. signature_len    equ    $-signature
  3.  
  4. packet_int_msg    db    CR,LF
  5.         db    "Error: <packet_int_no> should be in the range 0x60 to 0x80"
  6.         db    '$'
  7.  
  8. verify_packet_int:
  9. ;enter with no special registers.
  10. ;exit with cy,dx-> error message if the packet int was bad,
  11. ;  or nc,zr,es:bx -> current interrupt if there is a packet driver there.
  12. ;  or nc,nz,es:bx -> current interrupt if there is no packet driver there.
  13.     cmp    packet_int_no,60h    ;make sure that the packet interrupt
  14.     jb    verify_packet_int_bad    ;  number is in range.
  15.     cmp    packet_int_no,80h
  16.     jbe    verify_packet_int_ok
  17. verify_packet_int_bad:
  18.     mov    dx,offset packet_int_msg
  19.     stc
  20.     ret
  21. verify_packet_int_ok:
  22.  
  23.     mov    ah,35h            ;get their packet interrupt.
  24.     mov    al,packet_int_no
  25.     int    21h
  26.  
  27.     lea    di,3[bx]        ;see if there is already a signature
  28.     mov    si,offset signature    ;  there.
  29.     mov    cx,signature_len
  30.     repe    cmpsb
  31.     clc
  32.     ret
  33.